using System;
using System.Collections.Generic;
using System.Text;

namespace Prologis.ShifterNT {


    public class FieldSourceList : Dictionary<string, GenericList<Field>> {
        
        /// <summary>
        /// 
        /// </summary>
        /// 
        public FieldSourceList() {
        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="source"></param>
        /// <param name="field"></param>
        /// 
        public void Add(string source, Field field) {

            if (ContainsKey(source)) {
                this[source].Add(field);
            } else {
                GenericList<Field> list = new GenericList<Field>();
                list.Add(field);
                this[source] = list;
            }

        }


        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        /// 
        public object Clone() {
            FieldSourceList list = new FieldSourceList();
            foreach (string key in this.Keys) {
                list[key] = (GenericList<Field>) this[key].Clone();
            }
            return list;
        }
    }
}
